﻿//更新回帖(+1)次数
function UpdatePlusForReply(ReplyID, Count) {
    $.ajax({
        type: 'post',
        url: '/ajaxforposts',
        data: 't=UpdatePlusForReply&ReplyID=' + ReplyID,
        success: function (result) {
            if (result == 1) {
                $("#ReplyPlusCount_" + ReplyID).empty();
                $("#ReplyPlusCount_" + ReplyID).text((Count + 1));
                $("#ReplyPlus_" + ReplyID).attr("href", "#");
                FollowTips("+1", "ReplyPlusCount_" + ReplyID);
            }
            else if (result == 0) {
                FollowTips("操作失败", "ReplyPlusCount_" + ReplyID);
            }
            else {
                FollowTips("您所在的组没有进行此操作的权限", "ReplyPlusCount_" + ReplyID);
            }
        }
    });
}

//更新主贴(+1)次数
function UpdatePlusForPosts(postsid, count) {
    $.ajax({
        type: 'post',
        url: '/ajaxforposts',
        data: 't=UpdatePlusForPosts&PostsID=' + postsid,
        success: function (result) {
            if (result == 1) {
                $("#PostsPlus_" + postsid).empty();
                $("#PostsPlus_" + postsid).text("(+1)(" + (count + 1) + ")");
                $("#PostsPlus_" + postsid).attr("href", "#");
                FollowTips("+1", "PostsPlus_" + postsid);
            }
            else if (result == 0) {
                FollowTips("操作失败", "PostsPlus_" + postsid);
            }
            else {
                FollowTips("您所在的组没有进行此操作的权限", "PostsPlus_" + postsid);
            }
        }
    });
}

//添加关注
function PostsAttentionAdd(postsid) {
    $.ajax({
        type: 'post',
        url: '/ajaxforposts',
        data: 't=PostsAttentionAdd&PostsID=' + postsid,
        success: function (result) {
            if (result != "") {
                if (result == "competence") {
                    FollowTips("您所在的组没有进行此操作的权限", "PostsAttention_" + postsid);
                }
                else{
                    FollowTips(result, "PostsAttention_" + postsid);
                }
            }
        }
    });
}

